<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>支付宝通通道</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" charset="utf-8" src="/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="/admin/welcomepage">首页</a>
       <a href="javascript:window.location.reload();">
          <cite>支付宝通道配置</cite>
        </a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:void(0);" onclick="reload_iframe();" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i>
    </a>
</div>
<div class="x-body">
    <blockquote class="layui-elem-quote">此处配置系统支付宝通道,方便做接口轮训,如果不需要轮训可以只添加一个接口并启用即可!</blockquote>
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" onsubmit="load_msg()" action="/admin/payconfig/alipay_list" method="get" id="ajaxForm">
            <div class="layui-input-inline ">
                <select name="status">
                    <option value="" <%if(status! == null){%>selected<%}%> >状态</option>
                    <option value="0" <%if(status! == 0){%>selected<%}%> >禁用</option>
                    <option value="1" <%if(status! == 1){%>selected<%}%> >启用</option>
                </select>
            </div>
            <div class="layui-input-inline ">
                <input type="text" name="name" value="${name!}" placeholder="通道名称" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline ">
                <input type="text" name="mchid" value="${mchid!}" placeholder="商户ID" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline ">
                <input type="text" name="appid" value="${appid!}" placeholder="应用ID" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-input-inline ">
                <button class="layui-btn" type="submit"><i class="layui-icon">&#xe615;</i></button>
            </div>
        </form>
    </div>
    <xblock>
        <button class="layui-btn" onclick="x_admin_show('添加通道','/admin/payconfig/alipay_add')"><i class="layui-icon"></i>添加通道
        </button>
        <span class="x-right" style="line-height:40px">共有数据：${bean.totalNum!0} 条</span>
    </xblock>
    <div id="dewdewfef">
        <%#ajax pagenode:{%>
        <table class="layui-table">
            <thead>
            <tr>
                <th>ID</th>
                <th>通道名称</th>
                <th>商户ID</th>
                <th>应用ID</th>
                <th>最小支持</th>
                <th>最大支持</th>
                <th>支付方式</th>
                <th>状态</th>
                <th>操作</th>
            </thead>
            <tbody>
            <%for(o in bean.items!){%>
            <tr>
                <td>${o.id!}</td>
                <td>${o.epayName!}</td>
                <td>${o.pid!}</td>
                <td>${o.appId!}</td>
                <td>${o.minPayMoney!0.01}&nbsp;元</td>
                <td>${o.maxPayMoney!0.00}&nbsp;元</td>
                <td><%if(o.payType! == 0){%>电脑/手机网站支付<%}else{%>当面付<%}%></td>
                <td><%if(o.status! == 0){%>禁用<%}else if(o.status! == 1){%>启用<%}else{%>未知<%}%></td>
                <td class="td-manage">
                    <a title="详情" onclick="x_admin_show('通道详情','/admin/payconfig/alipay_view?id=${o.id!}')" href="javascript:void(0);">
                        <i class="layui-icon">&#xe63c;</i>
                    </a>
                    <a title="编辑" onclick="x_admin_show('编辑','/admin/payconfig/alipay_edit?id=${o.id!}')" href="javascript:void(0);">
                        <i class="layui-icon">&#xe642;</i>
                    </a>
                    <a title="删除" onclick="member_del(this,'${o.id!}')" href="javascript:void(0);">
                        <i class="layui-icon">&#xe640;</i>
                    </a>
                </td>
            </tr>
            <%}%>
            </tbody>
        </table>
        <div class="page">
            <%include("/include/page.html",{context:'dewdewfef',action:'/admin/payconfig/alipay_list',model:bean!}){}%>
        </div>
        <script>
            $(function () {
                layui.use('laydate', function () {
                    var laydate = layui.laydate;
                    //执行一个laydate实例
                    laydate.render({
                        elem: '#start' //指定元素
                    });
                    //执行一个laydate实例
                    laydate.render({
                        elem: '#end' //指定元素
                    });
                });
            });

            function member_del(obj, id) {
                layer.confirm('确认要删除吗？', function (index) {
                    layer.load(0);
                    $.post("/admin/payconfig/alipay_delete",
                        {"id":id},
                    function (data) {
                        layer.closeAll();
                        if (data.code ==0){
                            layer.msg(data.msg, {icon: 1, time: 800});
                            $(obj).parents("tr").remove();
                            reload_iframe();
                        }else{
                            layer.msg(data.msg, {icon: 2, time: 800});
                        }
                    },"json");
                });
            }

            window.onload  = close_loading_msg();

            function reload_iframe() {
                parent.obj = parent.layer.load(0);
                location.replace(location.href);
            }
        </script>
        <%}%>
    </div>
</div>
</body>
</html>